//index.js
var WxParse = require('../../wxParse/wxParse.js');
//获取应用实例 
var app = getApp()
Page({
  data: {
    weixin:'',
  },
  onShow:function(){
    
  },
  onReady:function(){
   
  },
  onLoad: function () {
    this.getMsg();
  },


  //获取专属客服
  getMsg() {
    var that = this;
    wx.request({
      url: app.globalData.api + '/app.php?c=User&a=getService',
      data:
      {
        token: app.globalData.token,
      },
      header: {
        "Content-Type": "application/x-www-form-urlencoded",
        'platform': '' + app.globalData.platform,
        'version': '' + app.globalData.version,
      },
      method: 'POST',
      dataType: 'json',
      success: function (res) {
        console.log(res);
        if (res.data.code == 0) {
          that.setData({
            weixin:res.data.data.weixin
          })
          
        } else {
          wx.showToast({
            title: '' + res.data.msg,
            icon: 'none',
            duration: 1000
          })
        }

      }, fail: function () {

      }
    });
  },
  onReady: function () {
    wx.setNavigationBarTitle({
      title: '专属客服'
    })
  },
})
